<?php

 


require_once 'PHPUnit/Framework.php';
require_once 'PHPUnit/Util/Filter.php';
require_once 'PHPUnit/Util/Type.php';

PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT');


class PHPUnit_Framework_Constraint_ClassHasAttribute extends PHPUnit_Framework_Constraint
{
    protected $attributeName;

    public function __construct($attributeName)
    {
        $this->attributeName = $attributeName;
    }

    
    public function evaluate($other)
    {
        $class = new ReflectionClass($other);

        return $class->hasProperty($this->attributeName);
    }

    
    public function toString()
    {
        return sprintf(
          'has attribute "%s"',

          $this->attributeName
        );
    }
}
?>
